<!--
/**************************************************
* @ marketinfomanage.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/05/25, Jenny Li
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../../common.jsp" %>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>市场信息</title>
	<META http-equiv=Content-Type content="text/html; charset=UTF-8">
	<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
	<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
	<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
	<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>
</head>
<%
	ResultProcess tRs = (ResultProcess)request.getAttribute("marketinfo");
	ArrayList tList = new ArrayList();
%>
<script>
	function selectCompany()
	{
		var url = "<%=response.encodeURL(root+"/A401103.do")%>";
           var returnv = window.open(url,null," edge: sunken ,center: Yes, help: No, resizable: Yes, status: No,height=580px, scrollbars=yes");

	}	
	function requery(){
		<% if(tRs != null){ %>
			parent.document.frames["topFrame"].window.document.all('affmrkinf').src = "<%=response.encodeURL(root+"/affimark.jsp")%>";
		<% } %>
		<%if("true".equals((String)request.getAttribute("requery"))){%>
			process('Q');
		<%}%>
	}
	function process(val){
		if(val == 'C'){
			marketinfoform.title.value ="";	
			marketinfoform.content.value ="";
			marketinfoform.providerName.value ="";
			marketinfoform.publishDateStr.value ="";
			marketinfoform.publishDateEnd.value ="";
			document.all.provider_id.value ="";															
		}else if(val == 'Q'){
			marketinfoform.action = "<%=response.encodeURL(root + "/A401102.do")%>";
			marketinfoform.submit();
		}else if(val == 'A'){
			var url = "<%=response.encodeURL(root + "/A401108.do")%>";
			window.open(url,'newwindow',"status:yes;unadorned:no;dialogWidth:1000px;dialogHeight:700px;help:yes;");
			//var returnVal = showModalDialog(url,window,"status:no;unadorned:no;dialogWidth:800px;dialogHeight:1000px;help:no;");
		}	
	}	
	function control(val1,val2){
		if(val1 == 'M'){
			var url = "<%=response.encodeURL(root + "/A401105.do?createDate=")%>" + val2;
			window.open(url,'newwindow',"status:yes;unadorned:no;dialogWidth:1000px;dialogHeight:700px;help:yes;");

		}else if(val1 == 'D'){
			marketinfomodform.createDate.value = val2;
			if(!confirm("是否删除此告示？")){
				return false;
			}
			marketinfomodform.title.value = marketinfoform.title.value;
			marketinfomodform.content.value = marketinfoform.content.value;
			marketinfomodform.providerName.value = marketinfoform.providerName.value;
			marketinfomodform.provider.value = marketinfoform.provider.value;			
			marketinfomodform.publishDateStr.value = marketinfoform.publishDateStr.value;
			marketinfomodform.publishDateEnd.value = marketinfoform.publishDateEnd.value;
			marketinfomodform.action = "<%=response.encodeURL(root + "/A401110.do")%>";
			marketinfomodform.submit();			
		}	
	}
</script>
<body BGCOLOR="#f5f5f5"	text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="requery();" >

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black">市场信息管理</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>
<br>
<form name="marketinfoform" method="get" >

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center>信息标题</TD>
					<TD left=left class="bg_row_odd">
						<input type="text" name="title" maxlength="500" value="<%=request.getParameter("title") == null? "":request.getParameter("title")%>">					
					</TD>					
					<TD class="bg_column" align=center>内容</TD>
					<TD align=left class="bg_row_odd">
						<input type="text" name="content" value="<%=request.getParameter("content") == null? "":request.getParameter("content")%>">
					</TD>					
				</TR>
				
				<TR height=20>
					<TD class="bg_column" align=center>调价供应商</TD>
					<TD left=left class="bg_row_odd" colspan="3">
						<input type="text" id="provider_name" name="providerName" readonly value="<%=request.getParameter("providerName") == null? "":request.getParameter("providerName")%>">					
						<input type="button" class="kuang" value="选择供应商" onClick="selectCompany();">
						<input type="hidden" class="kuang" name="provider" id="provider_id" value="<%=request.getAttribute("provider_id") == null? "":request.getAttribute("provider_id")%>">						
					</TD>					
				</TR>
				<TR height=20>	
					<TD class="bg_column" align=center>发布日期</TD>
					<TD align=left class="bg_row_odd" colspan="3">
					<input type="text"	name="publishDateStr" value="<%=request.getParameter("publishDateStr")==null?"":request.getParameter("publishDateStr")%>" length="20" onfocus="setday(this)" readonly> 
					到<input type="text"	name="publishDateEnd" length="20" value="<%=request.getParameter("publishDateEnd")==null?"":request.getParameter("publishDateEnd")%>" onfocus="setday(this)" readonly>
					</TD>
				</TR>				
			</table>
		</td>
	</tr>
</table>
<%
if(tRs != null){
    int totalRecords = 0;
    if(request.getAttribute("totalRecords")!=null){
        totalRecords=Integer.parseInt((String)request.getAttribute("totalRecords"));
    }
    int defaultPageSize =10;
    if(request.getAttribute("pageSize")!=null){
        defaultPageSize=Integer.parseInt((String)request.getAttribute("pageSize"));
    }
%>          
<page:pager total='<%=totalRecords%>' defaultPageSize='<%=defaultPageSize%>'></page:pager>
<%} %>
</form>
    <p align="center">  
		<input type="button" width="58" class="kuang" height="24" value="查询" onclick="process('Q')"/>&nbsp;
		<input type="button" width="58" class="kuang" height="24" value="清空" onclick="process('C')"/>
    </p>
    <%
    	if(tRs != null){
	%>    	    
    		<center>
    	    <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
    			<tr>
    				<td>
                    <form name='pager' method="post">
    	            	<table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=100% align=center border=0>
    	                    <tbody> 
    	                    <%
    	                    tList = tRs.getAllRecoreds();
    	                    if(tList != null && tList.size() > 0){
    	                    %>
							  <tr class="bg_column" height=20>
							    <td width="960" height="16" colspan="13" align="right">
										<!--导航条-->
							    		<page:navigator type='text' queryForm="marketinfoform"/>
							    </td>
							  </tr>	
							  <% 
	    	                    }
							  %>
    	                    <tr class="bg_column" height=20> 
    	                        <td class=top align=middle> 
    							</td>    	                    
    	                        <td class=top align=middle> 
    							</td>    	                        							
    	                        <td class=top align=middle> 
    	                        <div align="center" class="txt_content">信息标题</div>
    							</td>
    	                        <td class=top align=middle> 
    	                        <div align="center" class="txt_content">调价供应商</div>
    							</td>						
    	                        <td class=top align=middle> 
    	                        <div align="center" class="txt_content">发布日期</div>
    							</td>
    	                        <td class=top align=middle> 
    	                        <div align="center" class="txt_content">相关附件</div>
    							</td>
    	                        <td class=top align=middle> 
    	                        <div align="center" class="txt_content">详细信息</div>
    							</td>																																																																						
    						</tr>
				<%
				
				if(tList != null && tList.size() > 0){
				for(int i=0; i<tList.size(); i++){
				    GSMarketInfoQryVO tVO= (GSMarketInfoQryVO)tList.get(i);
					String tTempStr="";
					if(i%2==0){
						tTempStr="class=\"bg_row_odd\"";
					}else {
						tTempStr="class=\"bg_row_even\"";
					}
				%>
							<tr <%=tTempStr%> height=20>
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<input type="button" value="修改" class="kuang" onClick="control('M','<%=tVO.createDate%>')">
									</div>
								</td>	
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<input type="button" value="删除" class="kuang" onClick="control('D','<%=tVO.createDate%>')">
									</div>
								</td>									
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<a href="<%=response.encodeURL(root + "/A401111.do?createDate="+tVO.createDate) %>" target="_blank"><%=tVO.title%></a>
									</div>
								</td>	
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<%=tVO.providerName%>
									</div>
								</td>					
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<%=tVO.publishDate%>
									</div>
								</td>					
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<a href="<%=response.encodeURL(root + "/A401112.do?createDate=" + tVO.createDate) %>" ><%=tVO.fileName%></a>
<!--									<a href="<%=response.encodeURL(root + "/DownLoadFile?fileName=" + tVO.fileName) %>" ><%=tVO.fileName%></a>-->
									</div>
								</td>				
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<a href="<%=response.encodeURL(root + "/A401111.do?createDate="+tVO.createDate) %>" target="_blank">详细</a>
									</div>
								</td>																						
							</tr>
			<%
				}
			%>
						  <tr class="bg_column" height=20>
						    <td width="960" height="16" colspan="13" align="right">
									<!--导航条-->
						    		<page:navigator type='text' queryForm="marketinfoform"/>
						    </td>
						  </tr>					
			<%	
				}else{
					%>
					<font color="red">没有符合条件的市场信息</font>
			<%
				}
			%>
					</tbody>
				</table>
				</form>				  
			</td>
		</tr>
	</table>
	</center>	
	<center>						
	<table>
	<tr>
		<td align="center">
			<INPUT type="button" value="增加" class="kuang" onClick="process('A')">						
			<br>
		</td>
	</tr>
	</table>	
	</center>							
	<%    						
    	}
    	
    %>
<form name="marketinfomodform" method="post">
	<input type="hidden" name="createDate">
	<input type="hidden" name="title">
	<input type="hidden" name="content">
	<input type="hidden" name="providerName">
	<input type="hidden" name="provider">	
	<input type="hidden" name="publishDateStr">
	<input type="hidden" name="publishDateEnd">					
</form>    
</body>
</html>